#ifndef MUDNMUCKAIPLAYER
#define MUDNMUCKAIPLAYER

#include "actor.h"

class AiPlayer : public Actor
{

     public:
          AiPlayer(std::string name, Cell* cell,int hp) : Name(name), CurrentCell(cell), NextCell(cell), HP(hp){}

          void PathFind(Cell* TargetCell)
          {
               bool pathfound = false;
               Cell* NextCell;
               //First see if we are already adjacent
               for(int i =0; i < 8; i++)
               {
                    NextCell = CurrentCell.getAdj(i);
                    if(NextCell == TargetCell)
                         break;
               
               }
               //We were not adjacent so lets just look for the next closest cell that is not solid.
               if(NextCell != TargetCell)
               {
                    Cell* TestCell
                    for(int i=0; i < 8; i++)
                    {
                         TestCell = NextCell.adj(i);
                         if(TestCell.isCloser(TargetCell, NextCell) && !TestCell.isSolid())
                              NextCell = TestCell;  
                    }
               }
               MoveQ.push(NextCell);
          }

          void FollowTarget()
          {
               if(Target != this)
               {
                    StopMovement();
                    PathFind(Target->getCell());
               }          
          }
};
#endif
